import Vue from 'vue'
import App from './App.vue'
import router from '@/router'//引入路由器
import store from '@/store'
import { Button,MessageBox } from 'element-ui';
// Vue.component(Button.name, Button);
Vue.component(Button.name, Button);
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;


//引入vue懒加载
import VueLazyload from 'vue-lazyload'
import loadingGif from '@/assets/loading.gif'
Vue.use(VueLazyload, {
  loading: loadingGif //懒加载默认图片
})

Vue.config.productionTip = false
//三级联动 TypeNav
import TypeNav from '@/components/TypeNav';
import Pagination from '@/components/Pagination';
Vue.component(TypeNav.name,TypeNav)
Vue.component(Pagination.name,Pagination)
//引入mockServe.js
import "@/mock/mockServe";
//引入Swiper样式
// import 'swiper/swiper-bundle.min.css' 
import 'swiper/dist/css/swiper.css'
import 'swiper/dist/js/swiper.min'
//统一接口api暴露请求函数
import * as API from '@/api'
//引入表单验证插件
import '@/plugins/validate'
new Vue({
  render: h => h(App),
  beforeCreate() {
    //全局事件总线$bus
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  router,//$route $router
  store//$store
}).$mount('#app')
